<?php
!defined("EW_ROOT") && exit('No direct script access allowed');
/**
* Ecommerce Web Content Management System
* @copyright (c) 2011 ewcms team http://www.ewcms.org
* @license  GNU GENERAL PUBLIC LICENSE (GPLv3)
* @author iceweb
*/
class setting
{
	private static $theme='';
	private static $lang='';
	private static $dbConfig=array();
	
	/**
	 * 设置数据库配置文件
	 * @param array $dbConfig
	 */
	public static function setDb($dbConfig)
	{
		self::$dbConfig=$dbConfig;
	}
	
	/**
	 * 获取数据库选项
	 */
	public static function getDb()
	{
		return self::$dbConfig;
	}
	
	/**
	 * 设置主题
	 * @param string $theme
	 */
	public static function setTheme($theme)
	{
		self::$theme=$theme ?$theme :'default';
	}
	
	/**
	 * 获取主题
	 */
	public static function getTheme()
	{
		return self::$theme;
	}
	
	/**
	 * 设置语言选项
	 * @param string $lang
	 */
	public static function setLang($lang)
	{
		if(init::getUserLang()!==FALSE)
		{
			self::$lang=init::getUserLang();
		}
		else
		{
			self::$lang=$lang ?$lang :'chinese';
		}
	}
	
	/**
	 * 获取语言设置
	 */
	public static function getLang()
	{
		return self::$lang;
	}
}